package top.xphu.zip.entiy;

import com.alibaba.fastjson.JSONObject;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author xphu
 * @version 1.0
 * @date 2021/7/1 16:12
 */
public class Param {
    private LinkedHashMap<String, String> data;

    private Param() {
        this.data = new LinkedHashMap<String, String>();
    }

    public static Param build (){
        return new Param();
    }

    public Param put(String key, String value){
        this.data.put(key, value);
        return this;
    }

    public Param remover(String key){
        this.data.remove(key);
        return this;
    }

    /**
     * 解析成json
     * @return
     */
    public String toJsonString () {
        return JSONObject.toJSONString(this.data);
    };


    /**
     * 解析成json
     * @return
     */
    public Map<String, String> toMap() {
        return this.data;
    };

}
